Skip to content

Conversation

@zeitlinger
Copy link
Member

Fixes #2150

@zeitlinger
Copy link
Member Author

We need to add the baggage processor before the batch span processor (that is usually already configured) - because it can start to export as soon as it's offered the span - see https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java#L177-L182

@trask fyi since we discussed this

@trask
Copy link
Member

trask commented Aug 22, 2025

We need to add the baggage processor before the batch span processor (that is usually already configured) - because it can start to export as soon as it's offered the span - see https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java#L177-L182

hm, I feel like this would have been a bigger problem if batch span processor wasn't always added last in this typical situation (and not sporadic then)

@trask trask dismissed their stale review August 22, 2025 14:26

sorry, not sure why this would be the fix still

@zeitlinger
Copy link
Member Author

hm, I feel like this would have been a bigger problem if batch span processor wasn't always added last in this typical situation (and not sporadic then)

Possible - but I didn't spot anything else.

@laurit do you have an idea?

@zeitlinger
Copy link
Member Author

We need to add the baggage processor before the batch span processor (that is usually already configured) - because it can start to export as soon as it's offered the span - see https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/export/BatchSpanProcessor.java#L177-L182

hm, I feel like this would have been a bigger problem if batch span processor wasn't always added last in this typical situation (and not sporadic then)

maybe it happens in the test due to the short delay: https://github.com/zeitlinger/opentelemetry-java-contrib/blob/00c7b2841f7c16371a6c4a7c3eae5358fd0e3516/baggage-processor/src/test/java/io/opentelemetry/contrib/baggage/processor/BaggageProcessorCustomizerTest.java#L109

I've included this PR in #2031 where the error is happening now

zeitlinger added a commit to zeitlinger/opentelemetry-java-contrib that referenced this pull request Sep 4, 2025
@zeitlinger
Copy link
Member Author

I've included this PR in #2031 where the error is happening now

This seems to have helped

@laurit
Copy link
Contributor

laurit commented Sep 5, 2025

@zeitlinger thanks for sorting this out, I have high hopes of this resolving the flaky test issue

zeitlinger and others added 2 commits September 5, 2025 14:27
…ge/processor/BaggageProcessorCustomizer.java

Co-authored-by: Trask Stalnaker <[email protected]>
…ge/processor/BaggageProcessorCustomizer.java

Co-authored-by: Trask Stalnaker <[email protected]>
@trask trask added this pull request to the merge queue Sep 5, 2025
Merged via the queue into open-telemetry:main with commit d96a030 Sep 5, 2025
25 checks passed
@zeitlinger zeitlinger deleted the fix-baggage-processor branch September 5, 2025 16:30
zeitlinger added a commit to zeitlinger/opentelemetry-java-contrib that referenced this pull request Sep 5, 2025
zeitlinger added a commit to zeitlinger/opentelemetry-java-contrib that referenced this pull request Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sporadic failing test in baggage-processor

4 participants